package com.ss.android.account.b;

import android.content.Context;
import com.bytedance.common.utility.collection.e;
import com.bytedance.common.utility.Logger;
import com.ss.android.account.bb;
import com.ss.android.account.model.SpipeUser;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public final class UserListManager extends aa {
    static {
        new e();
    }

    public UserListManager(Context arg1) {
        super(arg1);
    }

    public final void a(SpipeUser arg9) {
        if(arg9 == null) {
            return;
        }

        Iterator<com.ss.android.account.model.SpipeUser> v3 = this.b.iterator();
        int v0;
        do {
            if(v3.hasNext()) {
                if(arg9.mUserId != v3.next().mUserId) {
                    continue;
                }

                v3.remove();
                v0 = 0;
                break;
            }
            else {
                v0 = 1;
               break;
            }
        }
        while(true);

        this.b.add(0, arg9);
        if(v0 != 0) {
            ++this.a;
            try {
                bb.a().d();
            }
            catch(Exception v0_1) {
                Logger.w("UserListManager", "refresh update when follow exception:" + v0_1);
            }
        }
    }

    public final void b(SpipeUser arg7) {
        if(arg7 != null) {
            Iterator<com.ss.android.account.model.SpipeUser> v1 = this.b.iterator();
            do {
                if(v1.hasNext()) {
                    if(arg7.mUserId != v1.next().mUserId) {
                        continue;
                    }

                    break;
                }

                return;
            }
            while(true);

            v1.remove();
            --this.a;
        }
    }

    protected final List c() {
        return new ArrayList();
    }
}

